﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using LTSMZ.life.Model;
using LTSMZ.life.BLL;
using Webdiyer.WebControls.Mvc;

namespace LTSMZ.life.Admin.Controllers
{
    public class MemberController : Controller
    {
        //
        // GET: /Member/
        MemberBll bll = new MemberBll();
        public ActionResult Index()
        {
            return View();
        }
        public ActionResult MemberShow(int pageIndex=1)
        {
            int pageSize = 10;
            PagedList<Member> list = new PagedList<Member>(bll.ShowMember(), pageIndex, pageSize);
            return View(list);
        }
        public ActionResult DelMember(int id)
        {
            if(bll.DelMember(id)>0)
            {
                return Content("<script>alert('删除成功');location.href='/Member/MemberShow'</script>");
            }
            else
            {
                return Content("<script>alert('系统繁忙，请稍后进行');location.href='/Member/MemberShow'</script>");
            }
        }
    }
}
